import java.util.*;
public class NextTo extends Hint{

	public NextTo(){
	}
	
	public NextTo(Unit[] units){
		super(units);
	}
	
	public void applyHint(){
		applyHint(units[0], units[1]);
	}
	
	public void applyHint(Unit A, Unit B){
		Unit tmpAL = (Unit) A.cloneShiftLeft();
		Unit tmpAR = (Unit) A.cloneShiftRight();
		Unit tmpBL = (Unit) B.cloneShiftLeft();
		Unit tmpBR = (Unit) B.cloneShiftRight();
		
		tmpAL.or(tmpAR);
		tmpBL.or(tmpBR);
		
		A.and(tmpBL);
		B.and(tmpAL);
	}
	
	public String toString(){
		return ""+units[0].getSymbol()+"^"+units[1].getSymbol();
	}
}